

#ifndef _PLUGINMANAGER_H__
#define _PLUGINMANAGER_H__

#include "PluginAPI.hpp"


#include <QDir>
#include <QPluginLoader>
#include <QListWidget>
#include <QVBoxLayout>
#include <QPushButton>
#include <QObject>
#include <QAction>
#include <QPair>

#include "PluginInterface.hpp"



NAMESPACE_BEGIN(NSPluginManager)

class PLUGINAPI PluginManager : public QObject {
    Q_OBJECT
    SIGNALDEC(PluginManager, QObject)
protected:
    void Initialize();
    void Finalize();

public:
    PluginInterface* getPlugin(QString name);
    QMap<QString, QPair<QAction*, PluginInterface*>> getPlugins() { return loaded_plugins; };

public Q_SLOTS:
    void loadPlugins( /*load*/);

private:
    QMap<QString,QPair<QAction*, PluginInterface*>> loaded_plugins;


};

Q_DECLARE_METATYPE(PluginInterface*)

NAMESPACE_END


#endif // !_PLUGINMANAGER_H__
